/**
 * Created with JetBrains WebStorm.
 * User: Ender
 * Date: 6/2/13
 * Time: 7:02 PM
 * To change this template use File | Settings | File Templates.
 */

'use strict';

angular.module('ender.boardgames.template', [])
    .factory('template', function () {

        var customRules = [

        ];
        var ruleValues = {};
        var boardSize = {

        };

        return {
            name: "name",
            customRules: customRules,
            boardSize: boardSize,
            hasScore: false,
            canBlockPlayer: false,
            movesNeedMultipleTurns: false,
            preProcessBoard: function (board, players) {
            },
            processRules: function (rules) {
            },
            processPlayers: function (players) {
            },
            checkVictory: function (board, players) {
            },
            processCellClicked: function (board, row, column, currentPlayer) {
            },
            resetScore: function (players) {
            },
            isLegalMove: function (board, rowIndex, columnIndex, currentPlayer) {
            },
            updateScore: function (board, players) {
            },
            playerCanMove: function (board, player) {
            },
            evaluateVictory: function (board, players) {
            },
            getClassForCell: function () {
            },
            getClassForPlayerIndicator: function () {

            },
            moveHasBeenMade: function () {
            }
        }
    })
    .directive('endBoardgameTemplateCell', function factoryFunction() {
        return {
            restrict: 'C',
            link: function (scope, element, attrs) {
                scope.$watch('cell.attribute', function (newValue, oldValue) {
                    if (newValue) {

                    }
                });
            }
        };
    })
    .directive('endBoardgameTemplatePlayerIndicator', function factoryFunction() {
        return {
            restrict: 'C',
            link: function (scope, element, attrs) {
                scope.$watch('player.attribute', function (newValue) {
                    if (newValue) {

                    }
                });
            }
        };
    });
